<template>
  <div >
    <div class="bjls">
    <!-- 顶部 -->
     <van-nav-bar :title="obj.name" nav-bar-text-color='red'  left-arrow>
  <template #left>
    <van-icon name="arrow-left"  size="18" @click="$router.back()" />
  </template>
</van-nav-bar>
</div>
<div class="xiangqing">
    <div class="tupian">
  <img :src="baseUrl+obj.image_path" alt="">
</div>
<p class="huise">{{obj.description}}</p>
<div>
<div class="pusm">
  <p>{{obj.name}}</p>
  <div>
    <span>评分</span>
    <van-rate
  v-model="obj.rating"
  :size="16"
  color="#ffd21e"
  void-icon="star"
  void-color="#eee"
/>
    <span class="shoujia">{{obj.rating}}</span>
  </div>
  <p>
    {{obj.tips}}
  </p>
  <p>
    <span>评论数 {{obj.rating_count}} </span>
    <span>好评率 83% </span>
  </p>
</div>
<div></div>
</div>
</div>
     <!-- 购物车 -->
    <div class="cart">
      <div class="left">
        <h2>
          <span class="number">{{shopcount}}</span
          ><van-icon name="shopping-cart-o" color="#fff" />
        </h2>
        <div class="content">
          <div class="top"><span>￥ </span>{{priceList}}</div>
          <div class="foot">配送费 ￥<span>5</span>元</div>
        </div>
      </div>
      <div class="right">去结算</div>
    </div>
</div>
</template>


<script>
export default {
data() {
    return {
        priceList:0,
        shopcount:0,
        obj:{},
        baseUrl:'//elm.cangdu.org/img/',
        url:'',
        Details:{
  name: "热销榜",
  description: "大家喜欢吃，才叫真好吃。",
  id: 1,
  restaurant_id: 2,
  type: 1,
  icon_url: "5da3872d782f707b4c82ce4607c73d1ajpeg",
  is_selected: true,
  __v: 3
}
    }
},
methods: {
  onClickLeft(){}
},
created(){
if(localStorage.getItem('price')){
    this.priceList=JSON.parse(localStorage.getItem('price'))
}

if(localStorage.getItem('shopcount')){
    this.shopcount=JSON.parse(localStorage.getItem('shopcount'))
}

// console.log(91,this.$route.query.id-0,this.$route.query.url);
//请求数据
// menuDetails(this.$route.query.id-0).then(res=>{
//     console.log(95,res);
//     this.url=this.$route.query.url
// })
console.log(100,this.$route.query.obj);
this.obj=this.$route.query.obj
}

}
</script>


<style lang="less" scoped>
.xiangqing{
    padding-left: 10px;
    p{
        padding: 5px 0;
    }
}
/deep/.van-nav-bar__title{
  color: #fff;
}
.van-nav-bar{
  background-color: #3190e8;
  color: #fff;
  .van-icon{
    color: #fff;
  }
}
.huise{
  color: #666;
}   
img{
  height: 100%;
width: 90%;
}
.pusm{
  padding: 8px 0px;
  margin:  8px 0px;
}
.shoujia{
  color: #ff9648;
}
/deep/.bjls{
  background-color: #3190e8;
}
.cart {
  width: 100%;
  height: 49.9992px;
  background-color: #3d3d3f;
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  .left {
    width: 70%;
    display: flex;
    h2 {
      width: 40px;
      height: 40px;
      background-color: #3190e8;
      border-radius: 25.0008px;
      line-height: 40px;
      text-align: center;
      font-size: 38px;
      position: relative;
      top: -25px;
      left: 30px;
      border: 5px solid #3d3d3f;
      .number {
        position: absolute;
        top: -4px;
        left: 36px;
        display: block;
        font-size: 10px;
        line-height: 12px;
        width: 12px;
        color: #fff;
        text-align: center;
        background-color: red;
        border-radius: 6px;
        border: 1px solid red;
      }
    }
    .content {
      color: #fff;
      margin-left: 50px;
      line-height: 24px;
      .top {
        font-size: 20px;
      }
      .foot {
        font-size: 12px;
      }
    }
  }
  .right {
    flex: 1;
    background-color: #4cd964;
    line-height: 50px;
    font-size: 24px;
    text-align: center;
    color: #fff;
  }
}
</style>